﻿using IceMan.Domain;
using IceMan.ViewModels;
using IceMan.Views;
using Prism.Ioc;
using System.Windows;

namespace IceMan
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        protected override Window CreateShell()
        {
            if (MessageBox.Show("点击Yes，打开WPF窗口，点击No,打开Blazor窗口", "选择窗口", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                return Container.Resolve<MainWindow>();
            }
            else
            {
                return Container.Resolve<BlazorWindow>();
            }
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<IStateStore, JsonFileStore>();
            containerRegistry.RegisterInstance(new Config());
            containerRegistry.RegisterSingleton<StateManager>();
        }
    }
}
